<?php 
/**
Thêm loại tiền tệ "k" vào woocommerce
*/


add_filter('woocommerce_currencies', 'add_vnd');

function add_vnd($currencies){
    $currencies['d'] = __('đ', 'woocommerce');
    return $currencies;
}

add_filter('woocommerce_currency_symbol', 'add_vnd_symbol', 10, 2);

function add_vnd_symbol($currency_symbol, $currency){
    switch($currency){
        case "d": $currency_symbol = 'đ'; break;
    }

    return $currency_symbol;
} 
	
/**
Xử lý giá sản phẩm
*/
function Show_Price_html(){

	global $product;
	if ($product->is_on_sale() && isset($product->regular_price)) {
		echo '<p itemprop="price-regular" class="price-regular"><del>Giá cũ:'.woocommerce_price($product->regular_price).'</del>';
		echo '<p itemprop="price" class="price">Giá :'.woocommerce_price($product->get_price()).'</p>';
	}
	else{

		echo '<p itemprop="price" class="price">Giá :'.woocommerce_price($product->get_price()).'</p>';

	}

}
?>

